<script>
	export default {
		mounted() {
			// #ifdef APP-PLUS
			// plus.screen.lockOrientation('default');
			// #endif
		},
		onLaunch: function() {
			/**
			 * 检查是否有可更新版本
			 */
			console.log('当前Uview版本', uni.$u.config.v);
			this.$tools.version()
			let token = uni.getStorageSync('token')
			if (!token) {
				return uni.reLaunch({
					url: '/pages/login/index',
				});
			}
			
			// #ifdef APP-PLUS
			// plus.screen.lockOrientation('default');
			// plus.cache.clear();//清除缓存
			console.log('清除缓存成功')
			setTimeout((res) => {
				plus.screen.lockOrientation('landscape-primary'); // 锁定横屏
				plus.navigator.setFullscreen(true); // 隐藏状态栏
			}, 1000)
			plus.runtime.getProperty(plus.runtime.appid, widgetInfo => {
				uni.setStorageSync('version', widgetInfo.version)
				
				});
				
			// #endif
			/**
			 * uni.login ==> getCode
			 */
			// this.$tools.getCode().then(res => {
			// 	console.log('onLaunch Get Code', res)
			// })

		},
		onShow: function() {
			console.log('App Show')
			console.log('检测', res)
			
		},
		onHide: function() {
			console.log('App Hide')
		},
	}
</script>

<style lang="scss">
	page {
		background-color: $qy-bg-nav-color
	}

	/*每个页面公共css */
	@import "@/uni.scss";
	@import "@/uni_modules/uview-ui/index.scss";
	// @import "@/uni_modules/uview-ui/PublicCss.css";
	@import url("animate.css");
	@import "./css/main.less";
	// @import "common/demo.scss";
</style>